﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProductOrderEdit.aspx.cs"
    Inherits="GGFW.Web.DocumentsManage.ProducedOrderEdit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
    <link href="../extjs/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
    <link href="../css/style_of_1024.css" rel="stylesheet" rev="stylesheet" type="text/css" />
    <style type="text/css">
        /*显示竖线*/.x-grid3-cell-inner
        {
            border-right: 1px solid #eceff6;
        }
        ext-el-mask-msg
        {
            z-index: 0;
        }
    </style>
    <%
        string contextPath = "/" == HttpContext.Current.Request.ApplicationPath ? "/" : HttpContext.Current.Request.ApplicationPath + "/";
    %>

    <script type="text/javascript">
　        var strPath = "<%=contextPath %>";
    </script>

    <script type="text/javascript" src="<%=contextPath %>extjs/adapter/ext/ext-base.js"></script>

    <script type="text/javascript" src="<%=contextPath %>extjs/ext-all.js"></script>

    <script type="text/javascript" src="<%=contextPath %>extjs/ext-lang-zh_CN.js"></script>

    <script type="text/javascript" src="<%=contextPath %>scripts/foothill-core.js"></script>

    <script type="text/javascript" src="<%=contextPath %>scripts/validator.js"></script>

    <script type="text/javascript" src="<%=contextPath %>scripts/datepicker/WdatePicker.js"></script>

    <script type="text/javascript" src="<%=contextPath %>scripts/Public.js"></script>

    <script type="text/javascript" src="<%=contextPath %>scripts/DocumentsManage/Function.js"></script>

    <script type="text/javascript" src="<%=contextPath %>scripts/DocumentsManage/ProductOrderEdit.js"></script>

    <script type="text/javascript" src="<%=contextPath %>QuickUpload/CJL.0.1.min.js"></script>

    <script type="text/javascript" src="<%=contextPath %>QuickUpload/Upload.js"></script>

</head>
<body style="overflow: scroll; overflow-y: hidden;">
    <form id="form1" runat="server">
    <div>
        <table style="position: fixed; left: 0px; margin: 0px; border-bottom: 1px solid #8AC0D9;
            width: 100%; background: #ECF6FB;" cellpadding="0" cellspacing="0">
            <tr>
                <td colspan="8" style="background-image: url('../images/white-top-bottom.gif'); height: 24px;
                    font-size: 13px; font-weight: bold; padding-left: 5px; border-bottom: 1px solid #8AC0D9;">
                    生产单编辑
                </td>
            </tr>
            <tr style="height: 26px; font-weight: bold; font-size: 12px;">
                <%--<td style="width: 43px; padding-left: 5px;">
                    客户:
                </td>
                <td>
                    <input type="text" id="txt_pro_client_name" style="width: 92%; border: 1px solid #ECF6FB;
                        border-bottom: 1px solid #000; background: #ECF6FB;" onchange="UpdateProductInfo('product','client_name',this.value);" />
                </td>--%>
                <td style="width: 43px; padding-left: 5px;">
                    编号:
                </td>
                <td>
                    <input type="text" id="txt_pro_code" style="width: 92%; border: 1px solid #ECF6FB;
                        border-bottom: 1px solid #000; background: #ECF6FB;" onchange="UpdateProductInfo('product','code',this.value);" />
                </td>
                <td style="width: 43px;">
                    款名:
                </td>
                <td>
                    <input type="text" id="txt_pro_pro_name" style="width: 92%; border: 1px solid #ECF6FB;
                        border-bottom: 1px solid #000; background: #ECF6FB;" onchange="UpdateProductInfo('product','pro_name',this.value);" />
                </td>
                <td style="width: 43px;">
                    审核:
                </td>
                <td>
                    <input type="text" id="txt_pro_reviewer" style="width: 92%; border: 1px solid #ECF6FB;
                        border-bottom: 1px solid #000; background: #ECF6FB;" onchange="UpdateProductInfo('product','reviewer',this.value);" />
                </td>
                <td style="width: 43px;">
                    设计:
                </td>
                <td>
                    <input type="text" id="txt_pro_designer" style="width: 92%; border: 1px solid #ECF6FB;
                        border-bottom: 1px solid #000; background: #ECF6FB;" onchange="UpdateProductInfo('product','designer',this.value);" />
                </td>
            </tr>
        </table>
        <div style="height: 51px;">
        </div>
        <table cellpadding="0" cellspacing="0" style="margin: 0px; width: 1768px;">
            <tr>
                <%--Start Left TD--%>
                <td style="width: 1524px;">
                    <%--Start Title--%>
                    <table style="width: 100%; margin: 0px; text-align: center; border-bottom: 1px solid #8AC0D9;"
                        cellpadding="0" cellspacing="0">
                        <tr style="height: 26px; font-weight: bold; font-size: 12px;">
                            <td style="width: 29px; border-right: 1px solid #8AC0D9; background: #ECF6FB;" rowspan="3">
                                序<br />
                                <br />
                                <img src="../Images/add.png" style="border: 0px; cursor: pointer;" alt="add" title="点击添加行"
                                    onclick="AddGridRow(true);" />
                            </td>
                            <td colspan="4" style="border-bottom: 1px solid #8AC0D9; border-right: 1px solid #8AC0D9;
                                background: #ECF6FB;">
                                开料
                            </td>
                            <td colspan="2" style="border-bottom: 1px solid #8AC0D9; border-right: 1px solid #8AC0D9;
                                background: #ECF6FB;">
                                &nbsp;
                            </td>
                            <td colspan="4" style="border-bottom: 1px solid #8AC0D9; border-right: 1px solid #8AC0D9;
                                background: #ECF6FB;">
                                排发
                            </td>
                            <td colspan="6" style="border-bottom: 1px solid #8AC0D9; background: #ECF6FB;">
                                捲发
                            </td>
                            <td style="border-bottom: 1px solid #8AC0D9; background: #ECF6FB;">
                                <%--头皮--%>
                            </td>
                        </tr>
                        <tr style="font-weight: bold; width: 20px;">
                            <td style="width: 106px; border-right: 1px solid #8AC0D9; background: #ECF6FB;" rowspan="2">
                                深g
                            </td>
                            <td style="width: 106px; border-right: 1px solid #8AC0D9; background: #ECF6FB;" rowspan="2">
                                中g
                            </td>
                            <td style="width: 105px; border-right: 1px solid #8AC0D9; background: #ECF6FB;" rowspan="2">
                                浅g
                            </td>
                            <td style="width: 139px; border-right: 1px solid #8AC0D9; background: #ECF6FB;" rowspan="2">
                                开料尺寸
                            </td>
                            <td style="width: 79px; border-right: 1px solid #8AC0D9; background: #ECF6FB;" rowspan="2">
                                排发尺寸
                            </td>
                            <td style="width: 239px; border-right: 1px solid #8AC0D9; background: #ECF6FB;" rowspan="2">
                                排码尺码
                            </td>
                            <td style="width: 129px; border-right: 1px solid #8AC0D9; background: #ECF6FB;" rowspan="2">
                                备注
                            </td>
                            <td style="width: 79px; border-right: 1px solid #8AC0D9; background: #ECF6FB;" rowspan="2">
                                发条尺寸
                            </td>
                            <td style="width: 159px; border-right: 1px solid #8AC0D9; font-size: 10px; background: #ECF6FB;"
                                colspan="2">
                                十份配发条数
                            </td>
                            <td style="width: 79px; border-right: 1px solid #8AC0D9; background: #ECF6FB;" rowspan="2">
                                捲筒
                            </td>
                            <td style="width: 64px; border-right: 1px solid #8AC0D9; background: #ECF6FB;" rowspan="2">
                                方向
                            </td>
                            <td style="width: 64px; border-right: 1px solid #8AC0D9; background: #ECF6FB;" rowspan="2">
                                条/支
                            </td>
                            <td style="width: 129px; background: #ECF6FB;" rowspan="2">
                                备注
                            </td>
                            <td style="border-right: 1px solid #eceff6; background: #ECF6FB;" rowspan="2">
                                <%--种发尺寸--%>
                            </td>
                        </tr>
                        <tr style="font-weight: bold; font-size: 10px;">
                            <td style="width: 79px; border-right: 1px solid #8AC0D9; border-top: 1px solid #8AC0D9;
                                background: #ECF6FB;">
                                条
                            </td>
                            <td style="width: 79px; border-right: 1px solid #8AC0D9; border-top: 1px solid #8AC0D9;
                                background: #ECF6FB;">
                                寸
                            </td>
                        </tr>
                    </table>
                    <%--End Title--%>
                    <%--Start Ext EditorGridPanel--%>
                    <table style="margin: 0px;" cellpadding="0" cellspacing="0">
                        <tr>
                            <td colspan="16" style="background: #ECF6FB;">
                                <div id="divProductOrder_Main">
                                </div>
                            </td>
                        </tr>
                    </table>
                    <%--End Ext EditorGridPanel--%>
                </td>
                <%--End Left TD--%>
                <%--Start Right TD--%>
                <td valign="top">
                    <table cellpadding="0" cellspacing="0" style="margin: 0; border-left: 1px solid #8AC0D9;
                        text-align: center; width: 100%;">
                        <tr style="height: 26px; font-weight: bold; font-size: 12px; background: #ECF6FB;">
                            <td style="border-bottom: 1px solid #8AC0D9;">
                                头皮规格
                            </td>
                        </tr>
                        <tr style="height: 26px; font-weight: bold; background: #ECF6FB;">
                            <td style="border-bottom: 1px solid #8AC0D9;">
                                <input type="text" style="width: 92%; border: 1px solid #ECF6FB; border-bottom: 1px solid #000;
                                    text-align: center; background: #ECF6FB;" id="txt_proadd_toupi_guige" onchange="UpdateProductInfo('productadd','toupi_guige',this.value);" />
                            </td>
                        </tr>
                        <tr>
                            <td id="td_toupi_img1" style="border-bottom: 1px solid #8AC0D9;" onclick="showWinProductOrderImg('img_toupi_img1','hid_proadd_toupi_img1');">
                                <img src="" width="236px" height="10px" id="img_toupi_img1" alt="点击上传或更新图片" />
                                <input type="hidden" id="hid_proadd_toupi_img1" />
                            </td>
                        </tr>
                        <tr>
                            <td id="td_toupi_img2" onclick="showWinProductOrderImg('img_toupi_img2','hid_proadd_toupi_img2');">
                                <img src="" width="236px" height="10px" id="img_toupi_img2" alt="点击上传或更新图片" />
                                <input type="hidden" id="hid_proadd_toupi_img2" />
                            </td>
                        </tr>
                    </table>
                </td>
                <%--End Right TD--%>
            </tr>
            <%--Start Bottom TR--%>
            <tr>
                <td rowspan="6">
                    <table cellpadding="0" cellspacing="0" style="margin: 0; border-bottom: 1px solid #8AC0D9;
                        border-top: 1px solid #8AC0D9; text-align: left; width: 100%; height: 176px;">
                        <tr style="height: 25px;">
                            <td style="border-bottom: 1px solid #8AC0D9; border-right: 1px solid #8AC0D9; width: 319px;"
                                rowspan="2">
                                <textarea style="width: 98%; height: 80px; overflow-x: hidden; overflow-y: hidden;
                                    border: none;" id="txta_proadd_remark1" onchange="UpdateProductInfo('productadd','remark1',this.value);"></textarea>
                            </td>
                            <td style="border-bottom: 1px solid #8AC0D9; border-right: 1px solid #8AC0D9; width: 379px;"
                                rowspan="2">
                                <textarea style="width: 98%; height: 80px; overflow-x: hidden; overflow-y: hidden;
                                    border: none;" id="txta_proadd_remark2" onchange="UpdateProductInfo('productadd','remark2',this.value);"></textarea>
                            </td>
                            <td style="border-bottom: 1px solid #8AC0D9; border-right: 1px solid #8AC0D9; width: 449px;
                                font-weight: bold;">
                                <div style="float: left; width: 50%;">
                                    温度：<input type="text" id="txta_proadd_wendu" style="width: 168px; border: 1px solid #fff;"
                                        onchange="UpdateProductInfo('productadd','wendu',this.value);" />
                                </div>
                                <div>
                                    时间：<input type="text" id="txta_proadd_date" style="width: 168px; border: 1px solid #fff;"
                                        onclick="WdatePicker();" readonly="readonly" onchange="UpdateProductInfo('productadd','date',this.value);" />
                                </div>
                                <div style="clear: left;">
                                </div>
                            </td>
                            <td style="border-bottom: 1px solid #8AC0D9; border-right: 1px solid #8AC0D9; font-weight: bold;
                                text-align: center;">
                                发型图片（正）
                            </td>
                            <td style="border-bottom: 1px solid #8AC0D9; font-weight: bold; text-align: center;">
                                发型图片（反）
                            </td>
                        </tr>
                        <tr style="height: 60px;">
                            <td style="border-bottom: 1px solid #8AC0D9; border-right: 1px solid #8AC0D9; width: 449px;
                                font-weight: bold;">
                                <textarea style="width: 98%; height: 50px; overflow-x: hidden; overflow-y: hidden;
                                    border: none;" id="txta_proadd_remark3" onchange="UpdateProductInfo('productadd','remark3',this.value);"></textarea>
                            </td>
                            <td style="border-right: 1px solid #8AC0D9; text-align: center;" rowspan="2" onclick="showWinProductOrderImg('img_fx_zheng_image','hid_proadd_fx_zheng_image');">
                                <img src="" width="183px" height="144px" id="img_fx_zheng_image" alt="点击上传或更新图片" />
                                <input type="hidden" id="hid_proadd_fx_zheng_image" />
                            </td>
                            <td style="text-align: center;" rowspan="2" onclick="showWinProductOrderImg('img_fx_fan_image','hid_proadd_fx_fan_image');">
                                <img src="" width="182px" height="144px" id="img_fx_fan_image" alt="点击上传或更新图片" />
                                <input type="hidden" id="hid_proadd_fx_fan_image" />
                            </td>
                        </tr>
                        <tr style="height: 85px;">
                            <td style="border-right: 1px solid #8AC0D9;">
                                <textarea style="width: 98%; height: 80px; overflow-x: hidden; overflow-y: hidden;
                                    border: none;" id="txta_proadd_gaotou" onchange="UpdateProductInfo('productadd','gaotou',this.value);"></textarea>
                            </td>
                            <td style="border-right: 1px solid #8AC0D9;">
                                <textarea style="width: 98%; height: 80px; overflow-x: hidden; overflow-y: hidden;
                                    border: none;" id="txta_proadd_zaxiang" onchange="UpdateProductInfo('productadd','zaxiang',this.value);"></textarea>
                            </td>
                            <td style="border-right: 1px solid #8AC0D9;">
                                <textarea style="width: 98%; height: 80px; overflow-x: hidden; overflow-y: hidden;
                                    border: none;" id="txta_proadd_faxiang" onchange="UpdateProductInfo('productadd','faxiang',this.value);"></textarea>
                            </td>
                        </tr>
                    </table>
                </td>
                <td style="border-top: 1px solid #8AC0D9; border-left: 1px solid #8AC0D9; font-size: 12px;
                    font-weight: bold; text-align: center; height: 16px;">
                    <span style="font-weight: bold;">包装材料</span>
                </td>
            </tr>
            <tr>
                <td style="border-top: 1px solid #8AC0D9; border-left: 1px solid #8AC0D9; border-bottom: 1px solid #8AC0D9;">
                    <span style="font-weight: bold; padding-left: 8px;">发网:&nbsp;&nbsp;</span><input
                        type="text" id="txt_bz_fawan" style="width: 188px; border: 1px solid #fff; border-bottom: 1px solid #000;"
                        onchange="UpdateProductInfo('baozhuang','fawan',this.value);" />
                </td>
            </tr>
            <tr>
                <td style="border-left: 1px solid #8AC0D9; border-bottom: 1px solid #8AC0D9;">
                    <span style="font-weight: bold; padding-left: 8px;">塞纸:&nbsp;&nbsp;</span><input
                        type="text" id="txt_bz_saizhi" style="width: 188px; border: 1px solid #fff; border-bottom: 1px solid #000;"
                        onchange="UpdateProductInfo('baozhuang','saizhi',this.value);" />
                </td>
            </tr>
            <tr>
                <td style="border-left: 1px solid #8AC0D9; border-bottom: 1px solid #8AC0D9;">
                    <span style="font-weight: bold; padding-left: 8px;">纸条:&nbsp;&nbsp;</span><input
                        type="text" id="txt_bz_zhitiao" style="width: 188px; border: 1px solid #fff;
                        border-bottom: 1px solid #000;" onchange="UpdateProductInfo('baozhuang','zhitiao',this.value);" />
                </td>
            </tr>
            <tr>
                <td style="border-left: 1px solid #8AC0D9; border-bottom: 1px solid #8AC0D9;">
                    <span style="font-weight: bold; padding-left: 8px;">胶袋:&nbsp;&nbsp;</span><input
                        type="text" id="txt_bz_jiaodai" style="width: 188px; border: 1px solid #fff;
                        border-bottom: 1px solid #000;" onchange="UpdateProductInfo('baozhuang','jiaodai',this.value);" />
                </td>
            </tr>
            <tr>
                <td style="border-left: 1px solid #8AC0D9; border-bottom: 1px solid #8AC0D9;">
                    <span style="font-weight: bold; padding-left: 8px;">纸箱:&nbsp;&nbsp;</span><input
                        type="text" id="txt_bz_zhixiang" style="width: 188px; border: 1px solid #fff;
                        border-bottom: 1px solid #000;" onchange="UpdateProductInfo('baozhuang','zhixiang',this.value);" />
                </td>
            </tr>
            <%--End Bottom TR--%>
        </table>
        <%--保存按钮--%>
        <div style="position: fixed; right: 2px; top: 1px;">
            <input type="button" value="完成" id="btnSaveProductOrder" style="padding: 0px 10px;"
                onclick="javascript:window.location.href('ProductOrderList.aspx');" />
        </div>
    </div>
    </form>
    <div id="divProductOrderImg" style="display: none;">
        <form id="form2" action="../QuickUpload/Files.ashx" method="post" enctype="multipart/form-data">
        <table width="100%" cellpadding="0" cellspacing="0" style="text-align: center;">
            <tr>
                <td colspan="4">
                    <img id="imgProductOrder" src="" runat="server" />
                    <div>
                        (图片尺寸按页面高度缩放)</div>
                </td>
            </tr>
            <tbody id="idTable">
                <tr>
                    <td style="text-align: center; padding-top: 10px; padding-left: 1px;">
                        <input id="fileQuick" name="file" type="file" style="height: 20px; width: 300px;" />
                        <input id="idQuick" type="button" value="上传" style="height: 20px; width: 80px;" />
                    </td>
                </tr>
            </tbody>
            <tr>
                <td style="padding-top: 5px;">
                    <span id="span_info">请选择图片文件（*.jpg,*.gif,*.png,*.bmp)</span>
                </td>
            </tr>
        </table>
        </form>

        <script type="text/javascript">
            var qus = [], count = 0, table = $$("idTable"), model = table.removeChild(table.rows[0]);

            function addUploadRS() {
                var row = model.cloneNode(true),
                inputs = row.getElementsByTagName("input"),
                file = inputs[0]
                msg = document.getElementById("span_info");
                qu = new QuickUpload(file, {
                    action: "../QuickUpload/Files.ashx",
                    timeout: 30,
                    onReady: function() {
                        count++;
                        show("文件上传中，请稍候..");
                        //设置表单
                        this.parameter.title = "Img_" + Math.random();
                    },
                    onFinish: function(iframe) {
                        try {//处理返回信息(需要后台配合)
                            var info = eval("(" + iframe.contentWindow.document.body.innerHTML + ")");
                            show("<font color='green'>图片上传成功</font>");
                        } catch (e) {//获取数据出错
                            show("<font color='red'>上传失败</font>"); stop(); return;
                        }
                        count--; CheckBtn();
                        document.getElementById(imgProductOrderImgID).src = "../UploadFile/" + info.ImgName;
                        document.getElementById("imgProductOrder").src = "../UploadFile/" + info.ImgName;
                        document.getElementById(hidProductOrderImgID).value = info.ImgName;
                    },
                    onStop: function() { show("<font color='red'>已经停止</font>"); stop(); },
                    onTimeout: function() { show("<font color='red'>上传超时</font>"); stop(); }
                });

                function stop() {
                    count--; CheckBtn();
                    file.style.display = "";
                }

                function show(m) { msg.innerHTML = m; }

                file.onchange = function() { show(this.value ? "<font color='blue'>准备上传</font>" : "选择文件"); }
                qus.push(qu);
                table.appendChild(row);
            }

            addUploadRS();

            $$("idQuick").onclick = function() {
                $$A.filter(qus, function(qu) { qu.upload(); });
            }

            function CheckBtn() {
                $$("idQuick").disabled = !!count;
            }

            function ResetFile(file) {
                file.value = ""; //ff chrome safari
                if (file.value) {
                    if ($$B.ie) {//ie
                        with (file.parentNode.insertBefore(document.createElement('form'), file)) {
                            appendChild(file); reset(); removeNode(false);
                        }
                    } else {//opera
                        file.type = "text"; file.type = "file";
                    }
                }
            }
        </script>

    </div>
</body>
</html>
